#@layoutT("联系人")
#define main()
	#@formStart()
		#@queryStart('名称')
		   <input type="search" name="xName" autocomplete="off" class="layui-input" placeholder="名称"/>
		#@queryEnd()
		#@queryStart('客户名称')
		   <input type="search" name="xCustName" autocomplete="off" class="layui-input" placeholder="客户名称"/>
		#@queryEnd()
	#@formEnd()
	
	 	<div class='layui-row f-index-toolbar'>
		<div class='layui-col-xs12'>
			<div class="layui-btn-group">
				<button id='addBtn_' class="layui-btn layui-btn-normal layui-btn-sm">
				  <i class="layui-icon">&#xe608;</i> 新增
				</button>
				<button id='refreshBtn_' class="layui-btn layui-btn-normal layui-btn-sm">
				  <i class="layui-icon">&#xe669;</i> 刷新
				</button>			
				<button id='deleteBtn_' class="layui-btn  layui-btn-normal layui-btn-sm">
				  <i class="layui-icon">&#xe640;</i> 删除
				</button>		
			</div>
		</div>
	</div>
	<div class="layui-row  f-index-toolbar">
			<div class="layui-col-xs12">
   				<table id="maingrid" lay-filter="maingrid"></table>
   			</div>
   	</div>
   	
   	<!-- 	每行的操作按钮 -->
	<script type="text/html" id="bar_maingrid">
  		<a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
  		<a class="layui-btn layui-btn-xs layui-btn-danger lay-event="del">删除</a>
	</script>
#end

#define js()
<!-- 分页表格 -->
<script>
	

	gridArgs.title='客户';
	gridArgs.dataId='sID';
	gridArgs.deleteUrl='#(path)/portal/dbm/contact/delete';
	gridArgs.updateUrl='#(path)/portal/dbm/contact/edit/';
	gridArgs.addUrl='#(path)/portal/dbm/contact/add';
	//gridArgsoletUrl='#(path)/portal/dbm/customer/schedule';
	gridArgs.gridDivId ='maingrid';
	initGrid({id : 'maingrid'
			,elem : '#maingrid'
			,cellMinWidth: 80
			,cols : [ [
					{title: '主键',field : 'sID',width : 35,checkbox : true},						
					//{title:'序号',type:'numbers',width:35},
					{title: '客户', field: 'xCustName',width:120 },
        			{title: '名称', field: 'xName',width:120},
	        		{title: '微信消息ID', field: 'xWXOpenID',width:240},
	        		{title: '管理权限', field: 'xIsAdmin',width:100,templet:'#isadmin'},
	        		{title: '创建时间', field: 'sCreateTime',width:180},
	        		{title: '最后修改', field: 'sLastUpdate',width:180},
	        		{title: '版本', field: 'sVersion',width:80},
	        		//{title: '性别', field: 'sex',templet:'#sexStr'},				
					{title: '操作',fixed:'right',width : 120,align : 'left',toolbar : '#bar_maingrid'} // 这里的toolbar值是模板元素的选择器
			] ]
			,url:"#(path)/portal/dbm/contact/list"
			,searchForm : 'searchForm'
		});
	
</script>

<script type="text/html" id="isadmin">
	<input type="checkbox" name="xIsAdmin" value="{{d.sID}}" lay-skin="switch" lay-text="启用|关闭" {{ d.xIsAdmin == 1 ? 'checked' : '' }}>               
</script>
#end


 
 
 